﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TreaShares.Backoffice.Controlers;

namespace TreaShares.Backoffice.User
{
    public partial class UserSettings : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ObjectDataSource1_Updating(object sender, ObjectDataSourceMethodEventArgs e)
        {
            e.InputParameters["userId"] = this.Master.OrgBasicInfo.CurrentUserId.ToString();
            DropDownList ddlDateFormat = this.DetailsView1.FindControl("ddlDateFormat") as DropDownList;
            string selectedValue = ddlDateFormat.SelectedValue;
            e.InputParameters["dateFormat"] = selectedValue;
            e.InputParameters["dateFormatJS"] = ddlDateFormat.SelectedItem.Text;
            HttpContext.Current.Cache.Remove(this.Master.OrgBasicInfo.Id.ToString());
        }

        protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            e.InputParameters["userId"] = this.Master.OrgBasicInfo.CurrentUserId.ToString();
        }
    }
}